package com.example.demoview;

import org.springframework.web.servlet.ModelAndView;
import java.util.Map;
import java.util.List;
import java.util.HashMap;
import java.util.ArrayList;

public class Login {

    public String nowlogin(){
        //return "这是一个返回";
        return "login";
    }

    public ModelAndView logintest(){
        ModelAndView  model = new ModelAndView();
        model.setViewName("/login");//界面路径
        return  model;
    }


    public Map<String, User> getUserMap() {
        Map<String, User> userMap = new HashMap<>();
        //List<User> userList = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            User user = new User();
            user.setId(i);
            user.setUsername("hello spring boot" + i);
            user.setPassword("123456");
            userMap.put(i + "", user);
        }
        return userMap;
    }


}
